﻿<%
Function Merge(Num)
	Dim A,B,C,D,Str,I
	If IsNumeric(Num) And Len(Num)=4 Then
		Str="544147D3EFD2F4D1E9D6A4C2EB2020202020202020202020202020202020202020726561646C6F672E636E202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202032303037687474703A2F2F7777772E726561646C6F672E636E2020202020202000020D"
		A=mid(Session("GetCode"),1,1)
		B=mid(Session("GetCode"),2,1)
		C=mid(Session("GetCode"),3,1)
		D=mid(Session("GetCode"),4,1)
	Else
		Exit Function
	End If
	Dim Data1,Data2,Data3,data4
	Randomize
	Set S1=Server.CreateObject("Adodb.stream")
	Set S2=Server.CreateObject("Adodb.stream")
	Set S3=Server.CreateObject("Adodb.stream")
	Set S4=Server.CreateObject("Adodb.stream")
	S1.mode = 3
	S1.type = 1
	S1.open
	S2.mode = 3
	S2.type = 1
	S2.open
	S3.mode = 3
	S3.type = 1
	S3.open
	S4.mode = 3
	S4.type = 1
	S4.open
	S1.LoadFromFile(Server.Mappath("../Voice/"&Int(rnd*4+1)&"_"&A&".mp3"))
	Data1=S1.Read
	S2.LoadFromFile(Server.Mappath("../Voice/"&Int(rnd*4+1)&"_"&B&".mp3"))
	Data2=S2.Read()
	S3.LoadFromFile(Server.Mappath("../Voice/"&Int(rnd*4+1)&"_"&C&".mp3"))
	Data3=S3.Read()
	S4.LoadFromFile(Server.Mappath("../Voice/"&Int(rnd*4+1)&"_"&D&".mp3"))
	Data4=S4.Read()
	S1.close
	S2.close
	S3.close
	S4.close
	Set S1=Nothing
	Set S2=Nothing
	Set S3=Nothing
	Set S4=Nothing
	Response.AddHeader "Content-Length", Clng(lenb(Data1)+lenb(Data2)+lenb(Data3)+lenb(Data4))+128
	Response.CharSet = "UTF-8" 
	Response.ContentType = "application/octet-stream" 
	Response.BinaryWrite Data1
	Response.BinaryWrite Data2
	Response.BinaryWrite Data3
	Response.BinaryWrite Data4
	For I=1 To Len(Str) Step 2
		Response.BinaryWrite ChrB("&H"&Mid(Str,I,2))
	Next
	Response.Flush
End Function
Call Merge(Session("GetCode"))
%>